separation of variables method